<template>
<div class="">
    <h1>first</h1>   
    <h2>{{msg}}</h2> 
    <el-card class="box-card">
        <div slot="header" class="clearfix">
            <span>卡片名称</span>
            <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
        </div>
        <div v-for="topic in topics" class="text item">
            {{'列表内容 ' + topic.title }}
        </div>
    </el-card>
</div>
</template>


<script>
// 第三方代理
const API_PROXY = 'https://bird.ioliu.cn/v1/?url='
export default {
  name: 'First',
  data () {
    return {
      msg: '第一个组件页面',
      topics:[
          {
              "id": 102,
            "title": "1111",
          },
          {
              "id": 102,
            "title": "1111",
          }
      ]
    }
  },
  mounted:function () {
    console.log('mounted');
    var _this = this;
    console.log(this.topics);
    this.$http.get('/apiurl/api/topics')
    .then(function (response) {
        console.log(response.data.data);
        _this.topics = response.data.data
    })
    .catch(function (error) {
        console.log(error);
    });
  }
  
}
</script>